package com.nf;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class Student {

    public Student(){
        System.out.println("Student的实例被创建");
    }

    @Autowired
    @Qualifier("TT")
    private Car car;

    public void play(){
        System.out.println("出去玩");
        System.out.println("开车:"+car);
        car.drive();
    }
}
